package com.itheima.test02;

import java.util.TreeSet;

// 自然排序代码测试
public class Test {
    public static void main(String[] args) {
        Student student1 = new Student("张三", 23);
        Student student2 = new Student("王五", 28);
        Student student3 = new Student("王霸", 28);
        Student student4 = new Student("赵六", 12);
        Student student5 = new Student("赵六", 12);
        Student student6 = new Student("李四", 46);

        TreeSet<Student> treeSet = new TreeSet<>();
        treeSet.add(student1);
        treeSet.add(student2);
        treeSet.add(student3);
        treeSet.add(student4);
        treeSet.add(student5);
        treeSet.add(student6);

        System.out.println(treeSet);
    }
}
